Virtualization includes computing virtualization, network virtualization, and storage virtualization. Storage virtualization provides storage and a storage service for a virtual machine, for example, performs a storage snapshot and storage live migration on the virtual machine. Currently, storage virtualization is mainly used as follows: storage is provided for the virtual machine by means of a storage frontend and a storage backend.
If storage is provided for the virtual machine by means of the storage frontend and the storage backend, when reading/writing disk data, a guest operating system (Guest OS) first sends a data read/write request to a driver of the storage frontend, and the driver of the storage frontend places the read/write request in an input output (IO) ring shared by the storage frontend and the storage backend, and then sends an interruption to the storage backend. After receiving an interruption notification, the storage backend fetches the read/write request from the IO ring, and then sends the read/write request to a path 1 or a path 2 in FIG. 1 according to a virtual machine configuration. Specifically, a path may be determined according to a virtual machine configuration file when the virtual machine is started.
In the path 1, there is no advanced storage service, or the advanced storage service relies on a storage area network (SAN) or a virtual SAN. However, the path 1 has a short path and a small storage delay, so that storage performance is relatively high. In the path 2, there is an advanced storage service, and the advanced storage service has multiple storage functions, for example, a virtual machine snapshot, virtual machine storage live migration, and virtual machine storage thin provisioning. However, the path 2 has a relatively long path and a relatively large storage delay, and consequently storage performance is relatively poor.
Currently, the virtual machine determines a path for the read/write request according to the virtual machine configuration file, and cannot flexibly use an appropriate path to process the read/write request according to a requirement of the read/write request. Consequently, both the storage performance and a storage function cannot be considered.